<?php
/**
 * Object Relational Persistence Mapping Class for table: service_encounter_map
 *
 * @package	com.athena
 * @author	LHV
 */
class EncounterTypeServiceMap extends ORDataObject {

	/**#@+
	 * Fields of table: service_encounter_map mapped to class members
	 */
	var $encounter_type_service_map_id		= '';
	var $service_id		= '';
	var $encounter_type		= '';
	/**#@-*/


	/**
	 * DB Table
	 */
	var $_table = 'encounter_type_service_map';

	/**
	 * Primary Key
	 */
	var $_key = 'encounter_type_service_map_id';
	
	/**
	 * Internal Name
	 */
	var $_internalName = 'EncounterTypeServiceMap';

	/**
	 * Handle instantiation
	 */
	function EncounterTypeServiceMap() {
		parent::ORDataObject();
	}
	
	public function getEncounterType($serviceId) {
		$sql = "SELECT encounter_type FROM $this->_table WHERE service_id = '$serviceId'";
		$res = $this->_execute($sql);
		if (!empty($res) && ($res->fields['encounter_type'] != '')) {
			return $res->fields['encounter_type'];
		}
		return 0;	
	}	
}
?>
